package com.water.app.mapper;

import com.water.app.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface userMapper {

    // 根据用户名查询用户
    public User selectUserByUsername(String username);

    //根据用户名密码查询用户
    public User selectUserByUsernameAndPassword(@Param("account") String account,@Param("password") String password);

    //判断qq邮箱只能对应一个username
    public int selectEmail(String email);

    //保存用户
    public int insertUser(User user);

    public User selectUserByAccount(String account);


    public int reviseUser(User user);

    public int increaseMoney(int sellerId, double sum);

    public int decreaseMoney(int userId, double total);

    public User selectUserByUserId(int userId);

    public int updateUserPicture(String picture,Integer userId);

    public int updateUserMsg(User user,Integer userId);

    public List<User> selectUserListByUserId(List<Integer> chatUserIds);

    public User selectUser(Integer userId);

     public int selectIsManager(Integer userId);
}
